from django.shortcuts import render,HttpResponse
from .models import Book

# Create your views here.

def book_add(request):
    book1 = Book(name="三国演义", author="罗贯中", price="100")
    book1.save()
    return HttpResponse("添加成功！")

def book_sort(request):
    book1 = Book.objects.all()
    for book in book1:
        print(book.name)
    return HttpResponse("排序成功！")
